import { createApp, onMounted } from 'vue'
import App from '@/App.vue'
import router from '@/router/index'
import 'amis/sdk/sdk.js'
import 'amis/lib/themes/default.css'
import 'element-plus/dist/index.css'
import ElementPlus from 'element-plus'
import zhLocale from 'element-plus/es/locale/lang/zh-cn'
import '@/assets/style/index.scss'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import '@/permission'
import { Vblur } from '@/directive'
import { createPinia } from 'pinia'

const pinia = createPinia()
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// 自定义指令，失去焦点
Vblur(app)
app
  .use(router)
  .use(ElementPlus, {
    locale: zhLocale
  })
  .use(pinia)
  .mount('#app')
